import Vue from 'vue'
import Vuex from 'vuex'
import persistedState from 'vuex-persistedstate'
import moduleProfile from './modules/profile'
import moduleGlobal from './modules/global'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    profile: moduleProfile,
    global: moduleGlobal
  },
  plugins: [
    persistedState({
      paths: ['profile'] // 持久化这些模块中的数据,防止刷新丢失
    })
  ]
})
